home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 July / macformat-026.iso / mac / Shareware City / Developers / SoundMate Plug-In Kit / How to write a Sound Effects next >
Encoding:
Text File  |  1995-01-26  |  3.2 KB  |  88 lines  |  [TEXT/ttxt]

  1. SoundMate Plug-In Developer Kit 1.0ß3
  2. Copyright 1995 Motion Works International
  3.  
  4. ABOUT:
  5. -------
  6. This kit allows programs to write plug-in modules for Motion Work's SoundMate program, part of the Multimedia Utilities.  
  7.  
  8. DISCLAIMER:
  9. -----------
  10. This development kit is a beta release and is provided as is.  Motion Works make no warranties as to the software or documentation and shall not be liable for any lost profits or damages suffered by the use of this software.  Motion Works does not provide technical support in regards to this kit.  Inquires, questions, problems, bug reports and such should be faxed to 415-541-0555.  Please do not call technical support.
  11.  
  12. USAGE:
  13. ------
  14. How to write a Sound Effect Component for SoundMate:
  15.  
  16. • make a copy of a sample folder (such as "Backwards.π ƒ") and rename the files appropriately
  17.  
  18. • write the _SEDoEffect function
  19.  
  20. it's arguments are:
  21.  
  22. Handle theSound
  23. - the sound your effect works on; don't modify it directly though if you want your effect to be undoable
  24.  
  25. Size *selectionStart, Size *selectionEnd
  26. - the current selection in samples; these can be modified
  27.  
  28. Handle *newSound
  29. - the new sound to be inserted, if any (an actual Macintosh sound, with header)
  30.  
  31. Size *insertStart
  32. - the point to insert newSound, and the start point of the samples to be deleted if deleteEnd is greater than insertStart
  33.  
  34. Size *deleteEnd
  35. - the end point of deletion, which will not occur unless deleteEnd is greater than insertStart
  36.  
  37. In case this is not clear, here's a code fragment from SoundMate that might help:
  38.  
  39. gEffects->RunEffect( itsEffect,
  40.                                   itsSound->GetSound(), 
  41.                                   &newSelectionStart, &newSelectionEnd,
  42.                                   &newSound,
  43.                                   &insertStart, &deleteEnd );
  44.                         
  45. if ( ( newSelectionStart != theStart || newSelectionEnd != theEnd )
  46.       && newSelectionEnd >= newSelectionStart )
  47. {
  48.     itsSound->SetSelection( newSelectionStart, newSelectionEnd );
  49. }
  50.  
  51. if ( deleteEnd > insertStart )
  52. {
  53.     itsSound->CutSamples( insertStart, deleteEnd );
  54. }
  55.  
  56. if ( newSound )
  57. {
  58.     thePasteLength = itsSound->InsertSound( newSound, insertStart );
  59.  
  60.     DisposeHandle( newSound );
  61. }
  62.  
  63. • make sure the _SEWorksOnSelectionOnly function answers appropriately
  64. (it should return TRUE if it should only be called if there is a selection, FALSE if it can always be called)
  65.  
  66. • build the 'CODE' resource
  67.  
  68. • make a copy of one of the existing Sound Effect Components and copy your new  'CODE' resource into it
  69.  
  70. • give it its own sub-type and creator codes in the 'thng' resource
  71.  
  72. • give it the name that should be used in the Effects menu in SoundMate in 'STR' resource 128 (and a description in number 129)
  73.  
  74. • update the 'vers' resource
  75.  
  76. • cut and paste the plug-in icon from the SoundMate Icon resource file located in your folder (icl8 resource 304) into your newly created plug-in.  There is also a folder icon you can use.
  77.  
  78. That's it.
  79.  
  80. By the way, do not modify SoundEffect.c & SoundEffect.h.  The #define DEBUG_SOUND_EFFECT should remain commented out unless you have the source to SoundMate, in which case you can include your component source and SoundEffect.c in SoundMate for source-code debugging.
  81.  
  82.  
  83. Release 1.5 INT, 1/25/95
  84. Document: COD-SUP-015
  85. Oliver Muoto
  86.  
  87.  
  88.